package ink.lovejinhu.leetcode;

import java.util.HashSet;

/**
 * @author jinhu
 * created 2021-07-25 9:34
 */
public class Solution_0575 {
    /**
     * 妹妹获得的种类需要最多
     *
     * @param candyType
     * @return
     */
    public int distributeCandies(int[] candyType) {
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < candyType.length; i++) {
            set.add(candyType[i]);
        }
        return Math.min(set.size(), candyType.length / 2);

    }
}
